#include "thread.hpp"
#include <unistd.h>
using namespace mythread;
void test()
{
    int cnt = 3;
    while (cnt--)
    {
        std::cout << "new thread" << std::endl;
        sleep(1);
    }
}

int main()
{
    thread td(test);
    td.Start();

    sleep(1);
    td.Cancel();
    
    sleep(2);

    td.Join();

    return 0;
}